# 选择排序python实现
def select_sort(arr):
    length = len(arr)
    for i in range(length):
        j = length - 1
        while j > i:
            if arr[i] > arr[j]:
                arr[i], arr[j] = arr[j], arr[i]
            j -= 1
    return


if __name__ == "__main__":
    arr = [2, 8, 4, 6, 1, 5, 7, 9, 0]
    select_sort(arr)
    print(arr)
